home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 1820 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.5 KB

  1. Path: blv-pm11-ip27.halcyon.com!user
  2. From: hawkfish@punchdeck.com (Richard Wesley)
  3. Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3
  4. Subject: Re: Hungarian notation
  5. Date: Fri, 12 Jan 1996 19:07:01 -0800
  6. Organization: Punch Deck Consulting
  7. Message-ID: <hawkfish-1201961907010001@blv-pm11-ip27.halcyon.com>
  8. References: <30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com> <1996Jan7.045815.8676@ohstpy> <4cpb00$nqk@news.xmission.com> <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com> <4csj8i$gsa@news.xmission.com>
  9. NNTP-Posting-Host: blv-pm11-ip27.halcyon.com
  10. X-Newsreader: Yet Another NewsWatcher 2.1.2
  11.  
  12. In article <4csj8i$gsa@news.xmission.com>, tknarr@xmission.com ( Todd
  13. Knarr ) wrote:
  14.  
  15. >In <hawkfish-0801960904580001@blv-pm3-ip24.halcyon.com>,
  16. hawkfish@punchdeck.com (Richard Wesley) writes:
  17. >
  18. >>I've found it useful to use typedefs for all sorts of things like this. 
  19. >>Looping through a FooArray with a FooIndex is much more robust than using
  20. >>a long or something.
  21. >
  22. >I try to avoid syntactic-saccharine typedefs when possible. There's no
  23. >language-level gain from typedef'ing an int or long to something else
  24. >just for that, and it virtually requires an explosion of variables to
  25. >deal with multiple arrays of different types. The result of using several
  26. >different variables to step through several different arrays at different
  27. >times, just because those arrays have elements of different types, tends
  28. >to be confusion. When the index is really significant then it makes sense
  29. >to use seperate variables ( eg. when nCurrentMerchItem holds the index of
  30. >the current item as other processing is done ), but as was pointed out
  31. >there are a lot of constructions where the index is only significant for
  32. >a line or two of code ( where your code is saying, basically, "Do >this<
  33. >to every item in the array." ).
  34.  
  35. Unfortuantely, I've found that it is more than "syntactic-saccharine". One
  36. of the things that drove me nuts when I was working with Windoze was that
  37. no one had any idea how big an index was supposed to be.  This caused me
  38. more tahn one serious problem with overflow when 16 bit ints were used
  39. instead of longs by people who weren't thinking.
  40.  
  41.  
  42. - rmgw
  43.  
  44. http://www.punchdeck.com/hawkfish/PunchDeck.html
  45.  
  46. ----------------------------------------------------------------------------
  47. Richard Wesley          | "Wind that frog!"
  48. hawkfish@punchdeck.com  |   - Tom Hanks ("Toy Story")
  49. ----------------------------------------------------------------------------
  50.